<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>The Yaf_Action_Abstract class</title>
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-base.css" />
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-medium.css" />

 </head>
 <body class="docs"><div class="navbar navbar-fixed-top">
  <div class="navbar-inner clearfix">
    <ul class="nav" style="width: 100%">
      <li style="float: left;"><a href="yaf-controller-abstract.setviewpath.html">« Yaf_Controller_Abstract::setViewpath</a></li>
      <li style="float: right;"><a href="yaf-action-abstract.execute.html">Yaf_Action_Abstract::execute »</a></li>
    </ul>
  </div>
</div>
<div id="breadcrumbs" class="clearfix">
  <ul class="breadcrumbs-container">
    <li><a href="index.html">PHP Manual</a></li>
    <li><a href="book.yaf.html">Yaf</a></li>
    <li>The Yaf_Action_Abstract class</li>
  </ul>
</div>
<div id="layout">
  <div id="layout-content"><div id="class.yaf-action-abstract" class="reference">

 <h1 class="title">The Yaf_Action_Abstract class</h1>
 

 <div class="partintro"><p class="verinfo">(Yaf &gt;=1.0.0)</p>


  <div class="section" id="yaf-action-abstract.intro">
   <h2 class="title">简介</h2>
   <p class="para">
    在Yaf中一个action可以采用单独定义<span class="classname"><strong class="classname">Yaf_Action_Abstract</strong></span>来实现。
    亦即，一个action方法也可以是一个<span class="classname"><strong class="classname">Yaf_Action_Abstract</strong></span>的派生类
   </p>
   <p class="para">
    Yaf需要一个可以被它所调用的入口点（比如PHP 5.3，它有一个新的魔术方法__invoke，但是Yaf不只支持PHP 5.3+，
    所以Yaf需要另一个魔术方法来执行完成这样的任务），所以在你自己的动作类里面必须要实现抽象方法 
    <span class="methodname"><a href="yaf-action-abstract.execute.html" class="methodname">Yaf_Action_Abstract::execute()</a></span>
   </p>
  </div>


  <div class="section" id="yaf-action-abstract.synopsis">
   <h2 class="title">类摘要</h2>


   <div class="classsynopsis">
    <div class="ooclass"></div>


    <div class="classsynopsisinfo">
     <span class="ooclass">
      <span class="modifier">class</span> <strong class="classname">Yaf_Action_Abstract</strong>
     </span>
     
     <span class="ooclass">
      <span class="modifier">extends</span>
       <a href="class.yaf-controller-abstract.html" class="classname">Yaf_Controller_Abstract</a>
     </span>
     {</div>

    <div class="classsynopsisinfo classsynopsisinfo_comment">/* 属性 */</div>
    <div class="fieldsynopsis">
     <span class="modifier">protected</span>
      <var class="varname"><a href="class.yaf-action-abstract.html#yaf-action-abstract.props.controller">$<var class="varname">_controller</var></a></var>;</div>


    
    <div class="classsynopsisinfo classsynopsisinfo_comment">/* 方法 */</div>
    <div class="methodsynopsis dc-description">
   <span class="modifier">abstract</span> <span class="modifier">public</span><span class="methodname"><a href="yaf-action-abstract.execute.html" class="methodname">execute</a></span>(<span class="methodparam"><span class="type"><a href="language.types.declarations.html#language.types.declarations.mixed" class="type mixed">mixed</a></span> <code class="parameter">$arg</code><span class="initializer"> = ?</span></span>, <span class="methodparam"><span class="type"><a href="language.types.declarations.html#language.types.declarations.mixed" class="type mixed">mixed</a></span> <code class="parameter">$...</code><span class="initializer"> = ?</span></span>): <span class="type"><a href="language.types.declarations.html#language.types.declarations.mixed" class="type mixed">mixed</a></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span><span class="methodname"><a href="yaf-action-abstract.getcontroller.html" class="methodname">getController</a></span>(): <span class="type"><a href="class.yaf-controller-abstract.html" class="type Yaf_Controller_Abstract">Yaf_Controller_Abstract</a></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="yaf-controller-abstract.getcontrollername.html" class="methodname">getControllerName</a></span>(): <span class="type">string</span></div>

    
    <div class="classsynopsisinfo classsynopsisinfo_comment">/* 继承的方法 */</div>
    <div class="methodsynopsis dc-description"><span class="modifier">final</span> <span class="modifier">private</span> <span class="methodname"><a href="yaf-controller-abstract.construct.html" class="methodname">Yaf_Controller_Abstract::__construct</a></span>()</div>
<div class="methodsynopsis dc-description"><span class="modifier">protected</span> <span class="methodname"><a href="yaf-controller-abstract.display.html" class="methodname">Yaf_Controller_Abstract::display</a></span>(<span class="methodparam"><span class="type">string</span> <code class="parameter">$tpl</code></span>, <span class="methodparam"><span class="type">array</span> <code class="parameter">$parameters</code><span class="initializer"> = ?</span></span>): <span class="type">bool</span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="yaf-controller-abstract.forward.html" class="methodname">Yaf_Controller_Abstract::forward</a></span>(<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type">string</span> <code class="parameter">$module</code></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type">string</span> <code class="parameter">$controller</code><span class="initializer"> = ?</span></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type">string</span> <code class="parameter">$action</code><span class="initializer"> = ?</span></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type">array</span> <code class="parameter">$paramters</code><span class="initializer"> = ?</span></span><br>): <span class="type"><span class="type void">void</span></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="yaf-controller-abstract.getinvokearg.html" class="methodname">Yaf_Controller_Abstract::getInvokeArg</a></span>(<span class="methodparam"><span class="type">string</span> <code class="parameter">$name</code></span>): <span class="type"><span class="type void">void</span></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="yaf-controller-abstract.getinvokeargs.html" class="methodname">Yaf_Controller_Abstract::getInvokeArgs</a></span>(): <span class="type"><span class="type void">void</span></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="yaf-controller-abstract.getmodulename.html" class="methodname">Yaf_Controller_Abstract::getModuleName</a></span>(): <span class="type">string</span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="yaf-controller-abstract.getname.html" class="methodname">Yaf_Controller_Abstract::getName</a></span>(): <span class="type">string</span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="yaf-controller-abstract.getrequest.html" class="methodname">Yaf_Controller_Abstract::getRequest</a></span>(): <span class="type"><a href="class.yaf-request-abstract.html" class="type Yaf_Request_Abstract">Yaf_Request_Abstract</a></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="yaf-controller-abstract.getresponse.html" class="methodname">Yaf_Controller_Abstract::getResponse</a></span>(): <span class="type"><a href="class.yaf-response-abstract.html" class="type Yaf_Response_Abstract">Yaf_Response_Abstract</a></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="yaf-controller-abstract.getview.html" class="methodname">Yaf_Controller_Abstract::getView</a></span>(): <span class="type"><a href="class.yaf-view-interface.html" class="type Yaf_View_Interface">Yaf_View_Interface</a></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="yaf-controller-abstract.getviewpath.html" class="methodname">Yaf_Controller_Abstract::getViewpath</a></span>(): <span class="type"><span class="type void">void</span></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="yaf-controller-abstract.init.html" class="methodname">Yaf_Controller_Abstract::init</a></span>(): <span class="type"><span class="type void">void</span></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="yaf-controller-abstract.initview.html" class="methodname">Yaf_Controller_Abstract::initView</a></span>(<span class="methodparam"><span class="type">array</span> <code class="parameter">$options</code><span class="initializer"> = ?</span></span>): <span class="type"><span class="type void">void</span></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="yaf-controller-abstract.redirect.html" class="methodname">Yaf_Controller_Abstract::redirect</a></span>(<span class="methodparam"><span class="type">string</span> <code class="parameter">$url</code></span>): <span class="type"><span class="type void">void</span></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">protected</span> <span class="methodname"><a href="yaf-controller-abstract.render.html" class="methodname">Yaf_Controller_Abstract::render</a></span>(<span class="methodparam"><span class="type">string</span> <code class="parameter">$tpl</code></span>, <span class="methodparam"><span class="type">array</span> <code class="parameter">$parameters</code><span class="initializer"> = ?</span></span>): <span class="type">string</span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="yaf-controller-abstract.setviewpath.html" class="methodname">Yaf_Controller_Abstract::setViewpath</a></span>(<span class="methodparam"><span class="type">string</span> <code class="parameter">$view_directory</code></span>): <span class="type"><span class="type void">void</span></span></div>


   }</div>


  </div>

  

  <div class="section" id="yaf-action-abstract.props">
   <h2 class="title">属性</h2>
   <dl>
    
     <dt id="yaf-action-abstract.props.module"><var class="varname">_module</var></dt>

     <dd>

      <p class="para"/>
     </dd>

    
    
     <dt id="yaf-action-abstract.props.name"><var class="varname">_name</var></dt>

     <dd>

      <p class="para"/>
     </dd>

    
    
     <dt id="yaf-action-abstract.props.request"><var class="varname">_request</var></dt>

     <dd>

      <p class="para"/>
     </dd>

    
    
     <dt id="yaf-action-abstract.props.response"><var class="varname">_response</var></dt>

     <dd>

      <p class="para"/>
     </dd>

    
    
     <dt id="yaf-action-abstract.props.invoke-args"><var class="varname">_invoke_args</var></dt>

     <dd>

      <p class="para"/>
     </dd>

    
    
     <dt id="yaf-action-abstract.props.view"><var class="varname">_view</var></dt>

     <dd>

      <p class="para"/>
     </dd>

    
    
     <dt id="yaf-action-abstract.props.controller"><var class="varname">_controller</var></dt>

     <dd>

      <p class="para"/>
     </dd>

    
   </dl>

  </div>



 </div>

 






















<h2>目录</h2><ul class="chunklist chunklist_reference"><li><a href="yaf-action-abstract.execute.html">Yaf_Action_Abstract::execute</a> — 执行动作</li><li><a href="yaf-action-abstract.getcontroller.html">Yaf_Action_Abstract::getController</a> — 得到控制器实例</li><li><a href="yaf-controller-abstract.getcontrollername.html">Yaf_Action_Abstract::getControllerName</a> — Get controller name</li></ul>
</div>
</div></div></body></html>